import {
	request,
} from '@/api/request';
const apiList = [{
		// /api/sale/myWork
		name: 'myWork',
		url: '/api/sale/myWork',
		method: 'GET',
		showlod:true
	},
	{
		// /api/sale/customerList
		name: 'customerList',
		url: '/api/sale/customerList',
		showlod:true
	},
	{
		// /api/user/createUser
		name: 'createUser',
		url: '/api/user/createUser'
	},
	{
		// /api/sale/eventList
		name: 'eventList',
		url: '/api/sale/eventList',
		method: 'GET',
		showlod: true
	},
	{
		// /api/sale/signIn
		name: 'signIn',
		url: '/api/sale/signIn',
	},
	{
		// /api/sale/signList
		name: 'signList',
		url: '/api/sale/signList'
	},
	{
		// /api/sale/signOut
		name: 'signOut',
		url: '/api/sale/signOut',
	},
	{
		// /api/customer/getGroup
		name: 'getGroup',
		url: '/api/customer/getGroup',
	},
	{
		// /api/sale/createExam
		name: 'createExam',
		url: '/api/sale/createExam',
	},
	{
		// /api/sale/getExamMy
		name: 'getExamMy',
		url: '/api/sale/getExamMy',
	},
	{
		// /api/sale/examInfo?id=1
		name: 'examInfo',
		url: '/api/sale/examInfo',
		method:'GET'
	},
	{
		// /api/sale/getMySubmitExam
		name: 'getMySubmitExam',
		url: '/api/sale/getMySubmitExam',
		method:'GET'
	},
	{
		// /api/sale/exam
		name: 'exam',
		url: '/api/sale/exam',
	},
	{
		// /api/customer/publicCustomer
		name: 'publicCustomer',
		url: '/api/customer/publicCustomer',
		method:'GET'
	},
	{
		// /api/customer/changeCustomer
		name: 'changeCustomer',
		url: '/api/customer/changeCustomer',
	},
	{
		// /api/sale/customerDetail
		name: 'customerDetail',
		url: '/api/sale/customerDetail',
		method:'GET'
	},
	{
		// /api/sale/customerTask
		name: 'customerTask',
		url: '/api/sale/customerTask',
		method:'GET'
	},
	{
		// /api/sale/customerRecord
		name: 'customerRecord',
		url: '/api/sale/customerRecord',
		method:'GET'
	},
	{
		// /api/sale/createTask
		name: 'createTask',
		url: '/api/sale/createTask',
	},
	{
		// /api/sale/createCustomerRecord
		name: 'createCustomerRecord',
		url: '/api/sale/createCustomerRecord',
	},
	{
		// /api/customer/edit
		name: 'editcustomer',
		url: '/api/customer/edit',
	},
	{
		// /api/sale/getTaskMy
		name: 'getTaskMy',
		url: '/api/sale/getTaskMy',
		method:'GET'
	},
	{
		// /api/sale/getTaskMyInfo
		name: 'getTaskMyInfo',
		url: '/api/sale/getTaskMyInfo',
		method:'GET'
	},
	{
		// /api/sale/editTask
		name: 'editTask',
		url: '/api/sale/editTask',
	},
	{
		// /api/sale/taskMyInfo
		name: 'taskMyInfo',
		url: '/api/sale/taskMyInfo',
		method:'GET'
	},
	{
		// /api/sale/dayInfo
		name: 'dayInfo',
		url: '/api/sale/dayInfo',
		method:'GET'
	},
	{
		// /api/sale/createDay
		name: 'createDay',
		url: '/api/sale/createDay',
	},
	{
		// /api/sale/getTaskCount
		name: 'getTaskCount',
		url: '/api/sale/getTaskCount',
		method:'GET'
	},
	{
		// /api/sale/dayUser
		name: 'dayUser',
		url: '/api/sale/dayUser',
		method:'GET'
	},
	{
		// /api/sale/getTaskCustomerCount?customer_id=1
		name: 'getTaskCustomerCount',
		url: '/api/sale/getTaskCustomerCount',
		method:'GET'
	}
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod: params.showlod
	})
	return mode
}, {})